package com.example.service1;

import com.cloud.logger.zchain.core.common.base.ResultMessage;
import com.cloud.logger.zchain.spring.annotation.EnableZchainServer;
import com.cloud.logger.zchain.zchainclient.http.RestClientTemplate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@SpringBootApplication
@EnableZchainServer
public class Service1Application {

	public static void main(String[] args) {
		SpringApplication.run(Service1Application.class, args);
	}
}
@RestController
class HomeController {


	private static final Log log = LogFactory.getLog(HomeController.class);

	private String url="http://localhost:1202";
	/**
	 * @ClassName: HomeController
	 * @author: wcy
	 * @param:  * @param null
	 * @return:
	 * @Decription:
	 * @Date: 2017/12/4
	 */
	@RequestMapping("/service1")
	public ResultMessage service1() throws Exception {
		RestClientTemplate.doGet("http://localhost:2002/service2");
		RestClientTemplate.doGet("http://localhost:2003/service4");
		RestClientTemplate.doGet("http://localhost:2003/service5");
		ResultMessage resultMessage = new ResultMessage();
		resultMessage.setCode(8200);
		resultMessage.setContent("{\"service\":\"s1\"}");
		return resultMessage;
	}

}